package router

import (
	"github.com/gin-gonic/gin"
	"github.com/jhoncy/schelper/handle"
	"github.com/jhoncy/schelper/middleware"
)

func AddRouter() *gin.Engine {
	r := gin.Default()

	//login
	r.POST("/auth/login", 				handle.SuperUserLogin)

	//core
	core := r.Group("/core")
	core.Use(middleware.JwtAuth(), middleware.RoleAuth())
	core.POST("/user", 					handle.SuperUserRegister)
	//setting
	setting := r.Group("/setting")
	setting.Use(middleware.JwtAuth(), middleware.RoleAuth())
	setting.POST("/rule", 				handle.CreateRule)
	setting.POST("/policy", 				handle.CreatePolicy)

	return r
}
